﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GBlog.Core.Entities;
using System.Data.Entity;

namespace GBlog.Core.Mapping
{
    public class ErrorMap : MapBase<Error, int>
    {
        public ErrorMap()
        {
            ToTable("Core_Error");
            RegisterID();
            Property(t => t.Controller).HasMaxLength(64);
            Property(t => t.Action).HasMaxLength(64);
            Property(t => t.Referrer).HasMaxLength(256);
            Property(t => t.Url).HasMaxLength(256);
            HasOptional(t => t.User).WithMany().HasForeignKey(t => t.UserID).WillCascadeOnDelete();
            RegisterDefault();
        }
    }
}